package it.avantsoft.ls.peer.message;

import it.avantsoft.ls.gl.data.Appraisals;

import java.io.DataOutputStream;
import java.io.IOException;

public class AppraisalMessage extends PeerMessage {
    private Appraisals appraisals;

    public AppraisalMessage(DataOutputStream out, Appraisals appraisals) {
        super(out);
        this.appraisals = appraisals;
    }

    public boolean send() {
        boolean sent = false;
        try {
            writeByte(APPRAISAL);
            write(appraisals.toByte());
            flush();
            sent = true;
        } catch (IOException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
        return sent;
    }
}
